package com.ambow.store.service;

import com.ambow.store.entity.Address;
import com.ambow.store.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
* @author MyComputer
* @description 针对表【t_address】的数据库操作Service
* @createDate 2022-11-08 19:20:12
*/
public interface AddressService extends IService<Address> {
    /**
     * 为用户添加新的收货地址
     * @param address
     * @param session
     */
    public void addUserAddress(Address address, HttpSession session);

    /**
     * 根据session中的uid获取用户地址并放在list集合中
     * @param session
     * @return
     */
    public List<Address> getAddressData(HttpSession session);

    /**
     * 设置默认收获地址
     * @param aid
     * @param uid
     * @param username
     */
    public void setDefaultAddress(Integer aid,Integer uid,String username);

    /**
     * 删除地址
     * @param aid
     * @param uid
     * @param username
     */
    public void deleteAddress(Integer aid,Integer uid,String username);

    /**
     * 根据收货地址数据的id，查询收获地址详情
     * @param aid
     * @param uid
     * @return
     */
    public Address getByAid(Integer aid,Integer uid);
}
